$('form').on('submit', function (e) {
    e.preventDefault()
    const data = $(this).serialize()
    updatePwdAPI(data, res => {d
        console.log(res)
        layer.msg(res.message)
        if (res.status === 0) {
            localStorage.removeItem('token')
            // 利用大网页去做跳转
            window.parent.location.href = '/login.html'
        }
    })
})

layui.form.verify({
    password: [
        /^[\S]{6,10}$/,
        '密码是6到10位, 不能有空格'
    ],
    // 新密码
    diff: function (value) {
        return (value === $('input[name=oldPwd').val()) && '新密码不能与原密码相同'
    },
    // 确认密码
    same: function (value) {
        return (value !== $('input[name=newPwd]').val()) && '确认密码一定要与新密码相同'
    }


})